package com.ynny.librarysystemmanager.mapper;

import com.ynny.librarysystemmanager.entity.Record;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface RecordMapper {


    int insert(Record record);

    int update(Record record);

    List<Record> selectAll(Record record);

    Record selectOne(Integer id);

    int delete(Integer id);


    Record selectRecordByBorrowerIdAndBookId(@Param("userId") Integer userId,
                                             @Param("bookId") Integer bookId);

    @Select("""
            SELECT *
            FROM record
            WHERE end_time < NOW()
""")
    List<Record> selectRecordsLessEndTime();
}
